package com.cgdata.morethreadselectdb;

import java.util.List;
import java.util.concurrent.Callable;

public class ThreadQuery implements Callable<List> {

    private String serach;//查询条件 根据条件来定义改类的属性

    private int bindex;//当前页数

    private int num;//每页查询多少条

    private String table;//要查询的表名，也可以写死，也可以从前面传

    private List page;//每次分页查询出来的数据

    public ThreadQuery(int bindex, int num, String table) {
        this.bindex = bindex;
        this.num = num;
        this.table = table;
    }

    @Override
    public List call() throws Exception {
        System.out.println(Thread.currentThread().getName()+"bindex"+bindex+"num"+num);
        // page = Db.find(" select * from table limit ?,? ",bindex,num)
        return page;
    }
}
